import { Form, Col, Row, Card } from 'antd';
import { AUTHTYPE } from 'configs/constants';


const layout = {
  labelCol: { span: 6 },
  wrapperCol: { span: 18 }
};

const FormItem = Form.Item;
const Header =  ({ menuDetails = {} }) => {
  return (
    <Card title="基础信息">
      <Form>
        <Row>
          <Col span={8}>
            <FormItem
              label="编号"
              {...layout}
            >
              {menuDetails.code || '-'}
            </FormItem>
          </Col>
          <Col span={8}>
            <FormItem
              label="名称"
              {...layout}
            >
              {menuDetails.name || '-'}
            </FormItem>
          </Col>
          <Col span={8}>
            <FormItem
              label="类型"
              {...layout}
            >
              {AUTHTYPE[menuDetails.type]  || '-'}
            </FormItem>
          </Col>
          <Col span={8}>
            <FormItem
              label="排序编号"
              {...layout}
            >
              {menuDetails.sortNum || '-'}
            </FormItem>
          </Col>
          <Col span={8}>
            <FormItem
              label="创建时间"
              {...layout}
            >
              {menuDetails.createTime || '-'}
            </FormItem>
          </Col>
          <Col span={8}>
            <FormItem
              label="更新时间"
              {...layout}
            >
              {menuDetails.updateTime || '-'}
            </FormItem>
          </Col>
        </Row>
      </Form>
    </Card>
  );
};

export default Header;